library(readxl)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(ggplot2)
library(plotly)
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
library(RColorBrewer)
library(rstudioapi)
## Warning: package 'rstudioapi' was built under R version 4.1.1
this.dir = rstudioapi::getActiveDocumentContext()$path
setwd(dirname(this.dir))
data.filename = 'Nina_TAF_RPV_20230201.XLS'
data.tanofivir = read_xls(data.filename,
range='B6:J38',
col_types = c('numeric', 'skip', 'skip', 'text', 'guess',
'numeric', 'numeric', 'skip', 'numeric'))
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B7 / R7C2: '4'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G7 / R7C7: '4.877'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J7 / R7C10: '1145.3029'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B8 / R8C2: '5'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G8 / R8C7: '4.894'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J8 / R8C10: '682.2532'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B9 / R9C2: '6'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G9 / R9C7: '4.905'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J9 / R9C10: '405.9534'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B10 / R10C2: '7'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G10 / R10C7: '4.913'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J10 / R10C10: '233.3646'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B11 / R11C2: '8'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G11 / R11C7: '4.919'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J11 / R11C10: '126.4434'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B12 / R12C2: '9'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G12 / R12C7: '4.926'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J12 / R12C10: '64.2587'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B13 / R13C2: '10'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G13 / R13C7: '4.927'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J13 / R13C10: '31.0484'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B14 / R14C2: '11'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G14 / R14C7: '4.928'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J14 / R14C10: '13.5178'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B15 / R15C2: '12'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G15 / R15C7: '4.927'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J15 / R15C10: '5.7271'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B16 / R16C2: '13'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G16 / R16C7: '4.930'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J16 / R16C10: '2.0695'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B17 / R17C2: '14'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B18 / R18C2: '15'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B19 / R19C2: '16'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B20 / R20C2: '17'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G20 / R20C7: '4.874'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J20 / R20C10: '1174.9629'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B21 / R21C2: '18'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G21 / R21C7: '4.894'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J21 / R21C10: '685.8564'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B22 / R22C2: '19'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G22 / R22C7: '4.908'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J22 / R22C10: '408.3145'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B23 / R23C2: '20'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G23 / R23C7: '4.917'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J23 / R23C10: '242.0120'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B24 / R24C2: '21'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G24 / R24C7: '4.922'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J24 / R24C10: '131.3083'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B25 / R25C2: '22'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G25 / R25C7: '4.926'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J25 / R25C10: '66.6893'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B26 / R26C2: '23'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G26 / R26C7: '4.931'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J26 / R26C10: '32.2542'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B27 / R27C2: '24'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G27 / R27C7: '4.932'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J27 / R27C10: '14.2579'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B28 / R28C2: '25'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G28 / R28C7: '4.934'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J28 / R28C10: '5.8964'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B29 / R29C2: '26'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G29 / R29C7: '4.933'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J29 / R29C10: '2.3528'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B30 / R30C2: '27'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B31 / R31C2: '28'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B32 / R32C2: '29'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B33 / R33C2: '30'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G33 / R33C7: '4.904'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J33 / R33C10: '514.4330'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B34 / R34C2: '31'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G34 / R34C7: '4.901'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J34 / R34C10: '561.7248'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B35 / R35C2: '32'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G35 / R35C7: '4.931'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J35 / R35C10: '31.7004'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B36 / R36C2: '33'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G36 / R36C7: '4.931'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J36 / R36C10: '33.0279'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B37 / R37C2: '34'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G37 / R37C7: '4.932'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J37 / R37C10: '11.7121'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B38 / R38C2: '35'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G38 / R38C7: '4.932'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J38 / R38C10: '11.2958'
data.rilpivirine = read_xls(data.filename,
range = 'B80:J112',
col_types = c('numeric', 'skip', 'skip', 'text', 'guess',
'numeric', 'numeric', 'skip', 'numeric'))
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B81 / R81C2: '4'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G81 / R81C7: '4.406'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J81 / R81C10: '336.2256'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B82 / R82C2: '5'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G82 / R82C7: '4.415'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J82 / R82C10: '186.5480'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B83 / R83C2: '6'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G83 / R83C7: '4.422'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J83 / R83C10: '98.8344'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B84 / R84C2: '7'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G84 / R84C7: '4.425'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J84 / R84C10: '50.6912'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B85 / R85C2: '8'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G85 / R85C7: '4.428'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J85 / R85C10: '25.5788'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B86 / R86C2: '9'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G86 / R86C7: '4.432'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J86 / R86C10: '12.7343'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B87 / R87C2: '10'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G87 / R87C7: '4.433'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J87 / R87C10: '6.5805'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B88 / R88C2: '11'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G88 / R88C7: '4.432'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J88 / R88C10: '3.2496'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B89 / R89C2: '12'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G89 / R89C7: '4.432'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J89 / R89C10: '1.6657'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B90 / R90C2: '13'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B91 / R91C2: '14'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B92 / R92C2: '15'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B93 / R93C2: '16'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B94 / R94C2: '17'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G94 / R94C7: '4.408'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J94 / R94C10: '335.2297'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B95 / R95C2: '18'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G95 / R95C7: '4.419'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J95 / R95C10: '169.6308'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B96 / R96C2: '19'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G96 / R96C7: '4.427'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J96 / R96C10: '86.9693'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B97 / R97C2: '20'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G97 / R97C7: '4.430'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J97 / R97C10: '45.1144'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B98 / R98C2: '21'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G98 / R98C7: '4.430'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J98 / R98C10: '22.1038'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B99 / R99C2: '22'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G99 / R99C7: '4.432'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J99 / R99C10: '10.9339'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B100 / R100C2: '23'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G100 / R100C7: '4.433'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J100 / R100C10: '5.4531'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B101 / R101C2: '24'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G101 / R101C7: '4.434'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J101 / R101C10: '2.8113'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B102 / R102C2: '25'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G102 / R102C7: '4.435'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J102 / R102C10: '1.3821'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B103 / R103C2: '26'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B104 / R104C2: '27'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B105 / R105C2: '28'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B106 / R106C2: '29'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B107 / R107C2: '30'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G107 / R107C7: '4.422'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J107 / R107C10: '123.0908'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B108 / R108C2: '31'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G108 / R108C7: '4.422'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J108 / R108C10: '129.7855'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B109 / R109C2: '32'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G109 / R109C7: '4.434'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J109 / R109C10: '7.5666'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B110 / R110C2: '33'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G110 / R110C7: '4.433'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J110 / R110C10: '7.1015'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B111 / R111C2: '34'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G111 / R111C7: '4.434'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J111 / R111C10: '2.1369'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in B112 / R112C2: '35'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in G112 / R112C7: '4.434'
## Warning in read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
## Coercing text to numeric in J112 / R112C10: '2.2197'
setClass('sample.prep',
slots = list(compound='character', n.cal='numeric', reps='numeric'))
tanofivir.prep = new('sample.prep', compound='tanofivir', n.cal=12, reps=2)
rilpivirine.prep = tanofivir.prep
rilpivirine.prep@compound = 'rilpivirine'
n = rilpivirine.prep@n.cal
data.rilpivirine.1 = data.rilpivirine %>%
cbind('stock' = c(rep(1, n), NA, rep(2, n), NA, rep(seq(3, 4), 3))) %>%
cbind('type' =
c(rep(
c(rep('Cal', n), 'blank'), 2),
rep('QC', 6))
) %>%
cbind('concentration' = c(
rep(c(200/2^(seq_len(12)-1), 0), 2),
rep(c(75, 3, 1), each = 2)
))
data.tanofivir.1 = data.tanofivir %>%
cbind('stock' = c(rep(1, n), NA, rep(2, n), NA, rep(seq(3, 4), 3))) %>%
cbind('type' =
c(rep(
c(rep('Cal', n), 'blank'), 2),
rep('QC', 6))
) %>%
cbind('concentration' = c(
rep(c(200/2^(seq_len(12)-1), 0), 2),
rep(c(75, 3, 1), each = 2)
))
rilpivirine.group = data.rilpivirine.1 %>% group_by(stock)
tanofivir.group = data.tanofivir.1 %>% group_by(stock)
rilpivirine.group.cal = rilpivirine.group %>%
filter(type == 'Cal')
cal.curve.rilpivirine = lm(Area ~ concentration, data = rilpivirine.group.cal, weights = 1/concentration)
summary(cal.curve.rilpivirine)
##
## Call:
## lm(formula = Area ~ concentration, data = rilpivirine.group.cal,
## weights = 1/concentration)
##
## Weighted Residuals:
## Min 1Q Median 3Q Max
## -4.6158 -1.5489 -0.4529 0.9609 3.9240
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.87302 1.11199 -0.785 0.444
## concentration 4.33438 0.08896 48.723 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.412 on 16 degrees of freedom
## (6 observations deleted due to missingness)
## Multiple R-squared: 0.9933, Adjusted R-squared: 0.9929
## F-statistic: 2374 on 1 and 16 DF, p-value: < 2.2e-16
tanofivir.group.cal = tanofivir.group %>%
filter(type == 'Cal')
cal.curve.tanofivir = lm(Area ~ concentration, data = tanofivir.group.cal, weights = 1/concentration)
summary(cal.curve.tanofivir)
##
## Call:
## lm(formula = Area ~ concentration, data = tanofivir.group.cal,
## weights = 1/concentration)
##
## Weighted Residuals:
## Min 1Q Median 3Q Max
## -7.9703 -1.1553 0.2077 1.6548 6.1099
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -4.8082 0.9344 -5.146 6.78e-05 ***
## concentration 23.1212 0.1057 218.719 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.915 on 18 degrees of freedom
## (4 observations deleted due to missingness)
## Multiple R-squared: 0.9996, Adjusted R-squared: 0.9996
## F-statistic: 4.784e+04 on 1 and 18 DF, p-value: < 2.2e-16
cal.plot.rilpivirine = ggplot(rilpivirine.group, mapping = aes(concentration, Area)) +
geom_point(aes(colour = stock, shape = type)) +
# stat
geom_smooth(data = rilpivirine.group.cal,
method = 'lm', mapping = aes(weight = 1/concentration),
formula = y ~ x, ) +
labs(title='rilpivirine calibration', x='concentration, ug/mL',
y='area, mAU*s') +
theme_classic()
#cal.plot
#
#cal.plotly = plot_ly(data = data.group, x = ~concentration, y = ~Area,
# color = ~stock, colors = "Reds", symbol = ~type)
#cal.plotly
cal.plot.rilpivirine
## Warning: Removed 6 rows containing non-finite values (stat_smooth).
## Warning: Removed 8 rows containing missing values (geom_point).

ggplotly(cal.plot.rilpivirine)
## Warning: Removed 6 rows containing non-finite values (stat_smooth).
cal.plot.tanofivir = ggplot(tanofivir.group, mapping = aes(concentration, Area)) +
geom_point(aes(colour = stock, shape = type)) +
# stat
geom_smooth(data = tanofivir.group.cal,
method = 'lm', mapping = aes(weight = 1/concentration),
formula = y ~ x, ) +
labs(title='tanofivir calibration', x='concentration, ug/mL',
y='area, mAU*s') +
theme_classic()
cal.plot.tanofivir
## Warning: Removed 4 rows containing non-finite values (stat_smooth).
## Warning: Removed 6 rows containing missing values (geom_point).

ggplotly(cal.plot.tanofivir)
## Warning: Removed 4 rows containing non-finite values (stat_smooth).
data.post.rilpivirine = rilpivirine.group %>%
mutate(calc.conc = (Area - cal.curve.rilpivirine$coefficients[1])/
cal.curve.rilpivirine$coefficients[2],
accuracy = calc.conc/concentration)
data.post.rilpivirine
data.post.rilpivirine.stock = data.post.rilpivirine %>% group_by(stock) %>%
summarise(avg.acc = mean(accuracy))
data.post.rilpivirine.stock
data.post.tanofivir = tanofivir.group %>%
mutate(calc.conc = (Area - cal.curve.tanofivir$coefficients[1])/
cal.curve.tanofivir$coefficients[2],
accuracy = calc.conc/concentration)
data.post.tanofivir
data.post.tanofivir.stock = data.post.tanofivir %>% group_by(stock) %>%
summarise(avg.acc = mean(accuracy))
data.post.tanofivir.stock